<!-- 驾照被扣分 -->
<template>
  <div>
    <ul class="record_list">
      <li v-for="item of accidentData">
        <div class="title orange">
          <i>扣分</i>
          <time class="time">{{item.time | formatDate}}</time>
          <div class="score">驾照被扣分:<b>{{item.degree}}</b></div>
        </div>
        <div class="con">
          <p v-if="item.totalMoney">
            <i class="icon_disk orange_disk ft12">￥</i>
            <b>罚款:</b>
            <span  class="fc_orange">{{item.totalMoney}}元</span>
          </p>
          <p v-if="item.address">
            <i class="icon_disk blue_disk ion ion-ios-location-outline"></i>
            <b>违章地点:</b>
            <span>{{item.address}}</span>
          </p>
          <p v-if="item.reason">
            <i class="icon_disk ion ion-android-alert"></i>
            <b>原因:</b>
            <span>{{item.reason}}</span>
          </p>
        </div>
      </li>
    </ul>
    <!--正在加载提示框-->
    <div is="loading" v-if="loadShow"></div>
    <!--加载失败弹框-->
    <div is="dialog-box" :message="dialogMessage" v-if="dialogShow" @close-dialog='closeDialog'></div>
    <div class="no_data" v-if="!accidentData.length">
      <i class="ion ion-ios-paper-outline"></i>
      <p>暂无数据</p>
    </div>
  </div>
</template>
<script type="text/javascript">
  // import '../../assets/css/incident_record.scss';
  import getInterface from '../../assets/js/insterface'
  import http from '../../assets/js/http_mixin'
  import card from '../../widget/card.vue'
  let dudectPointByYearUrl = getInterface.getDudectPointByYearUrl;
  export default{
    data(){
      return {
        accidentData: []              // 事故信息
      }
    },
    mixins: [http],
    components: {
      card
    },
    mounted(){
      document.title = '扣分记录';
      this.getInfo({
       url: dudectPointByYearUrl,
       param: {
       'empNo': this.$route.query.empNo
       },
       success: function (response) {
          console.log(response);
          if(response.data.resType == '00'){
            this.accidentData = response.data.data;
          }else{
            console.log(response.data.msg);
          }
       },
       fail: function (response) {
       this.dialogMessage = '请求失败，请稍后再试';
       this.dialogShow = true;
       }
       })
    }

  }
</script>